//检测数字

window.onload = init;
function init()
{
document.getElementById("requestpagenum").onblur = checknum;
}

function checknum(){
var strSource ="0123456789";
var ch;
var i;
var temp;
var mytotal = document.getElementById("mytotal").value ; 
var requestpagenum = document.getElementById("requestpagenum").value;
if(requestpagenum  == "")
alert("请输入跳转页面");
for (i=0;i<=(requestpagenum.length-1);i++)
{

    ch = requestpagenum.charAt(i);
    temp = strSource.indexOf(ch);
    if (temp==-1) 
    {
     alert("请输入数字");
     return false;
    }
}

    if(requestpagenum <= mytotal )
      return true;
    else 
    {
    requestpagenum = mytotal;
      alert("请输入正确页面");
      
      return false;
    }
}
